package main

import (
	"bufio"
	"fmt"
	"net/http"
)

func main(){
	resp,err := http.Get("http://gobyexample.com")
	if err != nil{
		fmt.Println(err)
		return
	}
	defer resp.Body.Close()

	fmt.Println("resp status:",resp.Status)

	scanner := bufio.NewScanner(resp.Body)
	for i := 0;scanner.Scan() && i < 5; i++ {
		fmt.Println(scanner.Text())
	}
		
    if err := scanner.Err(); err != nil {
        panic(err)
    }
}